from time import sleep

from common.util.logUtil.logUtil import LoggerUtil
from core.mqtt.libProject.reportData.report import report,report_collector

logger = LoggerUtil()


def run_report_Task() -> None:
    try:
        while True:
            report()
            sleep(5)
    except Exception as e:
        logger.error(f"run_report_Task: {e}")
        run_report_Task()

def run_report_collector() -> None:
    try:
        while True:
            report_collector()
            sleep(3600)
    except Exception as e:
        logger.error(f"run_report_Task: {e}")
        report_collector()